<!doctype html>
<html class="no-js">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="description" content="">
  <meta name="keywords" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <!-- Set render engine for 360 browser -->
  <meta name="renderer" content="webkit">
  <!-- No Baidu Siteapp-->
  <meta http-equiv="Cache-Control" content="no-siteapp"/>
  <title>asd</title>
</head>
<body style="overflow:hidden;">
<input type="button" value="测试" onclick="showNote()" />
<div><br><br><br><br>
body: The body text of the notification.<br>
data: Data to pass to ServiceWorker notifications<br>
icon: Can be either the URL to an icon image or an array containing 16x16 and 32x32 pixel icon images (see above).<br>
onClick: Callback to execute when the notification is clicked.<br>
onClose: Callback to execute when the notification is closed (obsolete).<br>
onError: Callback to execute when if the notification throws an error.<br>
onShow: Callback to execute when the notification is shown (obsolete).<br>
requireInteraction: When set to true, the notification will not close unless the user manually closes or clicks on it.<br>
serviceWorker: Path to the service worker script registered on Push mobile. Defaults to "sw.js" if a path is not specified.<br>
tag: Unique tag used to identify the notification. Can be used to later close the notification manually.<br>
timeout: Time in milliseconds until the notification closes automatically.<br>
vibrate: An array of durations for a mobile device receiving the notification to vibrate. For example, [200, 100] would vibrate first for 200 milliseconds, pause, then continue for 100 milliseconds. For more information, see below.
</div>
<script type="text/javascript" src="web_notification.min.js"></script>
<script type="text/javascript">
function showNote()
{
    Push.create('Hello World!', {
        tag: 'n1',
        body: '打开百度',
        icon: {
            x16: './uploads/app_Android.png',
            x32: './uploads/app_Apple.png'
        },
        requireInteraction: true,
        onClick: function(){
            window.open("https://www.baidu.com");
            Push.close('n1');
        }
    });
}
</script>
</body>
</html>